n = 121
import sys

num = [n]

while n != 1:
    num_list = list(str(n))
    n = 0
    for i in num_list:
        n = n + pow(int(i), 2)
    num.append(n)
    if len(num) != len(set(num)):
        print("no")
        sys.exit(0)
print("yes")
